import { request, config } from 'utils'
const { api } = config
const { product } = api

export async function checkProduct (params) {
  return request({
    url: product+'/'+params.pk,
    method: 'get',
    data: params,
  })
}

export async function create (params) {
  let data="name="+params.name
  return request({
    url: product+'/add/',
    method: 'post',
    data: data,
  })
}

export async function remove (params) {
  return request({
    url: product+'/delete/'+params.pk,
    method: 'delete',
    data: params,
  })
}

export async function update (params) {
  let data="name="+params.name
  return request({
    url: product+'/edit/'+params.pk,
    method: 'post',
    data: data,
  })
}

